---
title: "ol foreach · RUAL Documentation"
description: "Serves as a dynamic ol container."
canonical: https://docs.rual.nl/block-types/state ui/state_foreach_ol
language: en
---

# ol foreach

This block is part of the [`state ui`](https://docs.rual.nl/block-types/state%20ui) group and was last modified in core [`v13.0.7`](https://docs.rual.nl/core-versions/130007).

### Type Selection Required

This block requires you to select the data type you want to work with. You must manually select the type using the type selector modal. To access the modal, click the white button on the block.

Serves as a dynamic ol container.

- array required `array` This array is the source of data for generating the individual elements. • Hidden when other fields are filled

- state key required `value` This state key is the source of data for generating the individual elements. • Hidden when other fields are filled

- class `uiclass` Assigns a CSS class to the element. • Hidden when unused

- style `uistyle` Applies inline CSS style to the element • Hidden when unused

- attributes `uiattributes` Adds custom attributes to the element. • Hidden when unused

- state `state` Returns the element to the frontend state.

- iterator `execute_function` Allows you to execute a custom function to determine the content of each element.

A typical wiring for [ol foreach](https://docs.rual.nl/block-types/state%20ui/state_foreach_ol): [with values](https://docs.rual.nl/block-types/array/array_of_values) feeds the `array` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `state` pin; the function out pin wires to an [execute](https://docs.rual.nl/block-types/function%20execution/function_custom_execute_from_trigger) block.

![Studio canvas example for the ol foreach block: typical wiring for ol foreach.](https://docs.rual.nl/canvas-examples/state_foreach_ol.png)

### Version history

Introduced in [`v13.0.7`](https://docs.rual.nl/core-versions/130007).
